from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    #定位搜索框
    def sousuok(self):
        ele=(By.ANDROID_UIAUTOMATOR,'new UiSelector().text("搜索菜谱")')
        loc=self.find_ele(ele)
        return loc
    #定位输入框
    def shuruk(self):
        ele=(By.CLASS_NAME,'android.widget.EditText')
        loc=self.find_ele(ele)
        return loc
    #定位搜索按钮
    def sousuo(self):
        ele=(By.XPATH,'//android.widget.TextView[@text="搜索"]')
        loc=self.find_ele(ele)
        return loc
    #定位清空按钮
    def qingkong(self):
        ele=(By.ID,'com.xiachufang:id/search_suggest_right_text_view')
        loc=self.find_ele(ele)
        return loc
    #用例1断言元素定位
    def dy1(self):
        ele=(By.XPATH,'//android.widget.TextView[@text="综合"]')
        loc=self.find_ele(ele)
        return loc

    # 用例2断言元素定位
    def dy2(self):
        ele=(By.ID,'com.xiachufang:id/search_suggest_title_text_view')
        loc=self.find_ele(ele)
        return loc